<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dubbo 示例项目</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 40px;
            text-align: center;
        }

        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
        }

        .header p {
            font-size: 1.2em;
            opacity: 0.9;
        }

        .content {
            padding: 40px;
        }

        .section {
            margin-bottom: 40px;
        }

        .section h2 {
            color: #667eea;
            font-size: 1.8em;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 3px solid #667eea;
        }

        .api-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .api-card {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 25px;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .api-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
            border-color: #667eea;
        }

        .api-card h3 {
            color: #764ba2;
            font-size: 1.3em;
            margin-bottom: 15px;
        }

        .api-card p {
            color: #666;
            margin-bottom: 15px;
            line-height: 1.6;
        }

        .api-link {
            display: inline-block;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            transition: all 0.3s ease;
            font-weight: bold;
        }

        .api-link:hover {
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }

        .tech-stack {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 20px;
        }

        .tech-badge {
            background: #667eea;
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9em;
            font-weight: bold;
        }

        .info-box {
            background: #e7f3ff;
            border-left: 4px solid #667eea;
            padding: 20px;
            border-radius: 5px;
            margin-top: 20px;
        }

        .info-box h4 {
            color: #667eea;
            margin-bottom: 10px;
        }

        .info-box ul {
            list-style: none;
            padding-left: 0;
        }

        .info-box li {
            padding: 5px 0;
            color: #555;
        }

        .info-box li:before {
            content: "✓ ";
            color: #667eea;
            font-weight: bold;
            margin-right: 8px;
        }

        .footer {
            background: #2c3e50;
            color: white;
            text-align: center;
            padding: 20px;
            font-size: 0.9em;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🚀 Dubbo 示例项目</h1>
            <p>基于注解和XML的完整Dubbo分布式服务示例</p>
        </div>

        <div class="content">
            <!-- 技术栈 -->
            <div class="section">
                <h2>📦 技术架构</h2>
                <div class="tech-stack">
                    <span class="tech-badge">Dubbo 2.7.2</span>
                    <span class="tech-badge">Zookeeper 3.7.1</span>
                    <span class="tech-badge">Spring 5.2.9</span>
                    <span class="tech-badge">SpringMVC</span>
                    <span class="tech-badge">Java 8</span>
                    <span class="tech-badge">Logback</span>
                </div>
            </div>

            <!-- 用户服务API -->
            <div class="section">
                <h2>👤 用户服务接口（基于注解）</h2>
                <div class="api-grid">
                    <div class="api-card">
                        <h3>获取用户名</h3>
                        <p>根据用户ID获取用户名称信息</p>
                        <a href="user/getUserName?userId=1001" class="api-link">测试接口</a>
                    </div>
                    <div class="api-card">
                        <h3>用户注册</h3>
                        <p>注册新用户到系统</p>
                        <a href="user/register?username=zhangsan&password=123456" class="api-link">测试接口</a>
                    </div>
                </div>
            </div>

            <!-- 订单服务API -->
            <div class="section">
                <h2>📦 订单服务接口（基于XML）</h2>
                <div class="api-grid">
                    <div class="api-card">
                        <h3>获取订单信息</h3>
                        <p>根据订单ID查询订单详细信息</p>
                        <a href="order/getOrderInfo?orderId=100001" class="api-link">测试接口</a>
                    </div>
                    <div class="api-card">
                        <h3>创建订单</h3>
                        <p>为指定用户和产品创建新订单</p>
                        <a href="order/createOrder?userId=1001&productId=2001" class="api-link">测试接口</a>
                    </div>
                </div>
            </div>

            <!-- 项目特色 -->
            <div class="section">
                <h2>✨ 项目特色</h2>
                <div class="info-box">
                    <h4>双实现方式</h4>
                    <ul>
                        <li>UserService：基于@Service注解实现（Dubbo 2.7.2）</li>
                        <li>OrderService：基于XML配置实现</li>
                        <li>同时演示两种主流的Dubbo服务开发方式</li>
                    </ul>
                </div>
                <div class="info-box">
                    <h4>配置清晰</h4>
                    <ul>
                        <li>Properties配置：外部参数配置</li>
                        <li>XML配置：Spring Bean和Dubbo服务配置</li>
                        <li>配置与代码分离，易于维护</li>
                    </ul>
                </div>
                <div class="info-box">
                    <h4>开箱即用</h4>
                    <ul>
                        <li>完整的启动脚本（支持Linux/Mac/Windows）</li>
                        <li>详细的项目文档和使用说明</li>
                        <li>统一的日志格式，便于调试</li>
                    </ul>
                </div>
            </div>

            <!-- 使用说明 -->
            <div class="section">
                <h2>📖 快速开始</h2>
                <div class="info-box">
                    <h4>启动步骤</h4>
                    <ul>
                        <li>第一步：确保Zookeeper在192.168.1.150:2181上运行</li>
                        <li>第二步：启动注解方式服务提供者（端口20880）</li>
                        <li>第三步：启动XML方式服务提供者（端口20881）</li>
                        <li>第四步：部署Web消费者到Tomcat</li>
                        <li>第五步：访问本页面，点击上方按钮测试接口</li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="footer">
            <p>Dubbo Demo Project | Author: BCXJ | Version: 1.0 | 2025</p>
            <p>详细文档请查看项目根目录的 README.md 文件</p>
        </div>
    </div>
</body>
</html>

